﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="news-template-list.aspx.cs"
    Inherits="MediaMonitor.admin.news_template_list" MasterPageFile="~/admin.master"
    Theme="default" %>

<asp:Content ContentPlaceHolderID="Body" runat="server">

<div style="width:98%">


<div style="text-align:right;">
    <a href="news-template.aspx">New Template</a>
</div>

<br />

<asp:UpdatePanel ID="pnlUpdate" runat="server">
    <ContentTemplate>
    
    
<table>
    <tr>
        <td>Template Name</td>
        <td><asp:TextBox ID="tbTemplateName" runat="server" /></td>
        <td><asp:ImageButton ID="btnSearch" runat="server" OnClick="btnSearch_Click" SkinID="Search" /></td>
    </tr>
</table>

<asp:Label ID="lblMsg" runat="server" ForeColor="Red" Font-Bold="true" />
    <asp:GridView if="gvNewsTemplates" runat="server" AutoGenerateColumns="false"
    SkinID="AdminGrid" AllowPaging="false" DataSourceID="sqlDS" Width="98%" GridLines="Both"
    BorderColor="#bcbcbc" ID="gvNewsTemplates"  DataKeyNames="TemplateID">

<Columns>
    <asp:BoundField DataField="TemplateName" HeaderText="Template Name" />
    <asp:ImageField DataImageUrlField="Picture1" DataImageUrlFormatString="../sitefiles/get-thumb.aspx?f=../images/templates/{0}&w=100"
        ControlStyle-Width="100"  HeaderText="Picture 1" />
    <asp:ImageField DataImageUrlField="Picture2" DataImageUrlFormatString="../sitefiles/get-thumb.aspx?f=../images/templates/{0}&w=100"
        ControlStyle-Width="100"  HeaderText="Picture 2" />
    <asp:ImageField DataImageUrlField="Picture3" DataImageUrlFormatString="../sitefiles/get-thumb.aspx?f=../images/templates/{0}&w=100"
        ControlStyle-Width="100"  HeaderText="Picture 3" />
        <asp:HyperLinkField DataNavigateUrlFields="TemplateID" DataNavigateUrlFormatString="news-template.aspx?tid={0}" Text="Edit" />
      <asp:TemplateField>
        <ItemTemplate>
            <asp:LinkButton ID="lnkDelete" runat="server" ForeColor="Red" Text="Delete" OnCommand="gv_Delete" CommandArgument='<%#Eval("TemplateID")%>'></asp:LinkButton>
        </ItemTemplate>
      </asp:TemplateField>
</Columns>

</asp:GridView>

    </div>

    </ContentTemplate>
    </asp:UpdatePanel>

    <asp:SqlDataSource ID="sqlDS" runat="server" ConnectionString='<%$ConnectionStrings:DBAdex%>'
        SelectCommand="SELECT * FROM NewsTemplate ORDER BY TemplateName">
        
        </asp:SqlDataSource>

</asp:Content>